package cn.how2j.product;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.types.RedisClientInfo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RefreshScope
public class ProductController {
	
	
	
	
	
	@Resource
	RedisTemplate<String, String> redis;

	static String port = "8080";

	@RequestMapping("/products")
	public void products() {
		//ClientWorker
//        return null;
		for(RedisClientInfo info:redis.getClientList()) {
			System.out.println(info.getAddressPort());
		}
		 redis.opsForValue().set("12313", "123");
	}
}
